import request from '@/utils/request'

// 查询村民列表
export function listPeople(query) {
  return request({
    url: '/organization/people/list',
    method: 'get',
    params: query
  })
}
export function getFamilyPeople(query) {
    return request({
        url: '/organization/people/familyPeople',
        method: 'get',
        params: query
    })
}
// 查询村民详细
export function getPeople(peopleId) {
  return request({
    url: '/organization/people/' + peopleId,
    method: 'get'
  })
}

// 新增村民
export function addPeople(data) {
  return request({
    url: '/organization/people',
    method: 'post',
    data: data
  })
}

// 修改村民
export function updatePeople(data) {
  return request({
    url: '/organization/people',
    method: 'put',
    data: data
  })
}

// 删除村民
export function delPeople(peopleId) {
  return request({
    url: '/organization/people/' + peopleId,
    method: 'delete'
  })
}
export function auditPeople(data) {
    return request({
        url: '/organization/people/auditPeople',
        method: 'put',
        data: data
    })
}
export  function changeIsParty(peopleId,isParty) {
    const data = {peopleId:peopleId,isParty:isParty}
    return request({
        url: '/organization/people/changeIsParty',
        method: 'put',
        data: data
    })
}
export function setHeadCard(data) {
    return request({
        url: '/organization/people/setHeadCard',
        method: 'put',
        data: data
    })
}

export function doSetCommunity(data) {
    return request({
        url: '/organization/people/doSetCommunity',
        method: 'put',
        data: data
    })
}
// 查询村民积分流水列表
export function listScoreLog(query) {
  return request({
    url: '/organization/people/listScoreLog',
    method: 'get',
    params: query
  })
}
export function setGird(data) {
    return request({
        url: '/organization/people/setGird',
        method: 'put',
        data: data
    })
}
export function queryHeadCard(query) {
    return request({
        url: '/organization/people/queryHeadCard',
        method: 'post',
        params: query
    })
}

export function setIngoing(data) {
    return request({
        url: '/organization/people/setIngoing',
        method: 'post',
        data: data
    })
}

// 重置村民微信
export function resetPeopleWx(data) {
    return request({
        url: '/organization/people/resetWx' ,
        method: 'put',
        data: data
    })
}
export function resetCommonPeopleWx(data) {
    return request({
        url: '/organization/people/resetCommonWx' ,
        method: 'put',
        data: data
    })
}
